package com.senjoeson.teamfriends.base;

import android.app.Application;
import android.content.Context;
import android.os.Handler;

import com.baidu.mapapi.SDKInitializer;
import com.senjoeson.teamfriends.utils.FileUtils;

import cn.bmob.v3.Bmob;

/**
 * @author senjoeson
 * @date 2018/4/27
 */
public class App extends Application {


    protected static Handler handler;
    protected static int mainThreadId;
    public static Context mContext;
    public static boolean ThemeControl = false;

    @Override
    public void onCreate() {
        super.onCreate();
        handler = new Handler();
        mainThreadId = android.os.Process.myTid();
        mContext = getApplicationContext();
        Bmob.initialize(this, "bbc4b9775db993261b37b7e5abcc20ee");
        FileUtils.getInstance().init();
        SDKInitializer.initialize(this);


    }


    public static Context getContext() {
        return mContext;
    }


    /**
     * 获取全局handler
     *
     * @return 全局handler
     */
    public static Handler getHandler() {
        return handler;
    }

    /**
     * 获取主线程id
     *
     * @return 主线程id
     */
    public static int getMainThreadId() {
        return mainThreadId;
    }

}

